package com.mpyy.service.inventory;

import com.mpyy.dao.inventory.ProductBreakageMapperDaoInter;
import com.mpyy.pojo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @version 1.0
 * @Description productBreakageServiceImpl
 * @Author JW
 * @Date 2022-03-09 14:27
 */
@Service(value = "productBreakageServiceImpl")
public class ProductBreakageServiceImpl implements ProductBreakageServiceInter {
    @Autowired
    @Qualifier(value = "productBreakageMapperDao")
    private ProductBreakageMapperDaoInter productBreakageMapperDaoInter;

    /**
     * 获取仓库信息
     * @return
     */
    @Override
    public List<DepotInfo> searchDepotInfo() {
        return productBreakageMapperDaoInter.searchDepotInfo();
    }

    /**
     * 根据仓库ID获取信息
     * @param depotId
     * @return
     */
    @Override
    public DepotInfo searchDepotInfoByDepotId(String depotId) {
        return productBreakageMapperDaoInter.searchDepotInfoByDepotId(depotId);
    }

    /**
     * 获取经办人信息
     * @return
     */
    @Override
    public List<EmployeeInfo> searchHandlePersonInfo() {
        return productBreakageMapperDaoInter.searchHandlePersonInfo();
    }

    @Override
    public List<ProductBreakage> searchProductBreakageInfo(ProductBreakage productBreakage) {
        return productBreakageMapperDaoInter.searchProductBreakageInfo(productBreakage);
    }

    @Override
    public List<ProductBreakageDesc> searchBreakageDescInfo(ProductBreakageDesc productBreakageDesc) {
        return productBreakageMapperDaoInter.searchBreakageDescInfo(productBreakageDesc);
    }

    @Override
    public List<ProductBreakage> searchProductOverflowInfo(ProductBreakage productBreakage) {
        return productBreakageMapperDaoInter.searchProductOverflowInfo(productBreakage);
    }

    @Override
    public List<ProductBreakageDesc> searchOverflowDescInfo(ProductBreakageDesc productBreakageDesc) {
        return productBreakageMapperDaoInter.searchOverflowDescInfo(productBreakageDesc);
    }

    @Override
    public int insertProductBreakageDesc(List<ProductBreakageDesc> productBreakageDescList) {
        return productBreakageMapperDaoInter.insertProductBreakageDesc(productBreakageDescList);
    }

    @Override
    public int insertProductMoreDesc(List<ProductOverflowDesc> productOverflowDescList) {
        return productBreakageMapperDaoInter.insertProductMoreDesc(productOverflowDescList);
    }

    @Override
    public int insertProductBreakage(ProductBreakage productBreakage) {
        return productBreakageMapperDaoInter.insertProductBreakage(productBreakage);
    }

    @Override
    public int insertProductOverflow(ProductOverflow productOverflow) {
        return productBreakageMapperDaoInter.insertProductOverflow(productOverflow);
    }

    /**
     * 报损新增成功后更改对应的商品库存数量
     * @param productBreakageDesc 报损详情对象
     * @return 更改行数
     */
    @Override
    public int updateInventoryBadProNum(ProductBreakageDesc productBreakageDesc) {
        return productBreakageMapperDaoInter.updateInventoryBadProNum(productBreakageDesc);
    }

    /**
     * 报溢新增成功后更改对应的商品库存数量
     * @param productOverflowDesc 报溢详情对象
     * @return 更改行数
     */
    @Override
    public int updateInventoryMoreProNum(ProductOverflowDesc productOverflowDesc) {
        return productBreakageMapperDaoInter.updateInventoryMoreProNum(productOverflowDesc);
    }

    /**
     * 查询树形控件
     * @return
     */
    @Override
    public List<ProductType> searchTreeControl() {
        return productBreakageMapperDaoInter.searchTreeControl(null);
    }
}
